import { ReqMsgDetails } from "./models";
import req from "/@/api/req";

export enum Api {
  addMessageTemplates = "api/msg/messageTemplates/addMessageTemplates",
  deleteMessageTemplatesByIds = "api/msg/messageTemplates/deleteMessageTemplatesByIds",
  getMessageTemplatesByMessageType = "api/msg/messageTemplates/getMessageTemplatesByMessageType",
  getMsgTempPage = "api/msg/messageTemplates/page",
  updateMessageTemplates = "api/msg/messageTemplates/updateMessageTemplates",
  // 模板分组
  addMessageTemplateGroup = "api/msg/messageTemplates/addMessageTemplateGroup",
  deleteMessageTemplateGroupByIds = "api/msg/messageTemplates/deleteMessageTemplateGroupByIds",
  updateMessageTemplateGroup = "api/msg/messageTemplates/updateMessageTemplateGroup",
  getPushBusinessTypeMaps = "api/msg/messageTemplates/getPushBusinessTypeMaps",
  getMessageTemplateGroups = "api/msg/messageTemplates/getMessageTemplateGroups",
}

export function getMessageTemplatesByMessageType(data: ReqMsgDetails) {
  return req.post<boolean>({
    url: Api.getMessageTemplatesByMessageType,
    data,
  });
}
export function getPushBusinessTypeMaps() {
  return req.get<any>(
    {
      url: Api.getPushBusinessTypeMaps,
    },
    {
      useGlobalLoading: false,
    }
  );
}
